// 日期字符串转Date对象，例如：将"2005-12-15 09:41:30"转为Date对象;  
function dateStr2Date(dateStr){
	return new Date(Date.parse(dateStr.replace(/-/g, "/")));   
}

// 日期值转为日期字符串，例如：将"1313911334000"转为"2011-08-21 15:22:14"
function dateValue2DateStr(dateValue){
	var date = new Date(dateValue);
	var year = date.getFullYear();
	var month = date.getMonth()+1;
	var day = date.getDate();
	var hour = date.getHours();
	var minute = date.getMinutes();
	var second = date.getSeconds();
	return year + "-" + fillZeroStr(month) + "-" + fillZeroStr(day) + " " + fillZeroStr(hour) + ":" + fillZeroStr(minute) + ":" + fillZeroStr(second);
}

function fillZeroStr(x){
	return x<10 ? "0"+x: x;
}